local duoqi = fk.CreateSkill {
  name = "lingling__duoqi",
}

Fk:loadTranslationTable{
  ["lingling__duoqi"] = "夺气",
  [":lingling__duoqi"] = "当你使用【杀】指定目标后，你可以获得其一张手牌，然后你选择：弃置两张牌令之伤害+1；摸一张牌令之伤害-1。",

  ["#lingling__duoqi-invoke"] = "夺气：你可以获得 %dest 一张牌，然后弃牌加伤或摸牌减伤",
  ["#lingling__duoqi-card"] = "夺气：你需弃置两张牌令此【杀】伤害+1，或点击“取消”摸一张牌令此【杀】伤害-1",
}

duoqi:addEffect(fk.TargetSpecified, {
  anim_type = "offensive",
  can_trigger = function(self, event, target, player, data)
    return target == player and player:hasSkill(duoqi.name) and
      data.card and data.card.trueName == "slash" and
      data.to and not data.to:isKongcheng()
  end,
  on_cost = function(self, event, target, player, data)
    return player.room:askToSkillInvoke(player, {
      skill_name = duoqi.name,
      prompt = "#lingling__duoqi-invoke::" .. data.to.id
    })
  end,
  on_use = function(self, event, target, player, data)
    local room = player.room
    data.use.additionalDamage = data.use.additionalDamage or 0
    room:obtainCard(player, room:askToChooseCard(player, { target = data.to, flag = "h", skill_name = duoqi.name }), nil, fk.ReasonPrey, player, duoqi.name)
    local cards = room:askToDiscard(player, {
      min_num = 2,
      max_num = 2,
      include_equip = true,
      skill_name = duoqi.name,
      prompt = "#lingling__duoqi-card"
    })
    if #cards > 0 then
      data.use.additionalDamage = data.use.additionalDamage + 1
    else
      player:drawCards(1, duoqi.name)
      data.use.additionalDamage = data.use.additionalDamage - 1
    end
  end
})

return duoqi
